import React, { Component } from 'react'
//withRouter
//1. 引入 withRouter
import { withRouter } from 'react-router';
//2. 去除类前面的默认暴露
class TopHeader extends Component {
    render() {
        return (
            <div className="head"><button onClick={this.back}>&lt;</button></div>
        )
    }

    //声明事件回调
    back = () => {
        // console.log(this.props);
        //页面的后退
        this.props.history.goBack();
        // this.props.history.go(-3);
    }  
}
//3. 暴露内容为 withRouter 的函数调用返回值
export default withRouter(TopHeader);
